#! /usr/bin/perl -w
#------------------------------------------------
# Author:    kvkrishna
# Created:   Thu Jul  7 21:59:41 IST 2011
# File Name: Calculate
# 
# 
# 
# 
#------------------------------------------------
mkdir GoldCalcs ;
open FHSPlt, ">GoldCalcs/SubPlot" or die "Opening SPlt file failed...";
printf FHSPlt "plot ";
foreach $Trgt ( @ARGV ) {
        open FHAccu, ">GoldCalcs/GoldAccu$Trgt.cal" or die "Opening Accu file failed..";
        for ($i = $Trgt, $Trials = 0; $i > 0; $i--) {
                $CurEst = $Trgt / $i;
                $Trials += $CurEst;
                printf FHAccu "%.f\n", $Trials;
        }
        printf FHSPlt "\"GoldCalcs/GoldAccu$Trgt.cal\" ti \"$Trgt\" with line, ";
        close FHAccu;
}
printf FHSPlt "\"Hn.log\" using 1 ti \"n*Hn\" with line ";
close FHSPlt;
